package com.beijiteshop.shop.ui.shopcar.repo

import com.beijiteshop.libcommon.network.repo.BaseRepo
import com.beijiteshop.shop.model.api.request.AddShopCarRequest
import com.beijiteshop.shop.model.api.request.GetGoodCountRequest

/**
 * @Author LiaoZhongKai
 * @Date 2021/3/19 16:03
 * @Description
 */
class ShopCarRepo(private val service: ShopCarService) : BaseRepo(){

    fun addToShopCar(request: AddShopCarRequest) = service.addToShopCar(request)

    fun getShopCarList(page: Int) = service.getShopCarList(page)

    fun deleteGoods(id: String) = service.deleteGoods(id)

    fun addCount(id: String) = service.addCount(id)

    fun reduceCount(id: String) = service.reduceCount(id)

    fun getGoodCount(busGoodId: String,color: String?,specification: String) = if (color.isNullOrEmpty()) {
        service.getGoodCount(busGoodId, specification)
    }else{
        service.getGoodCount(busGoodId, color, specification)
    }
}